import { combineReducers, configureStore } from "@reduxjs/toolkit";

import userReducer from "./slice/userSlice";
import ticketReducer from './slice/ticketSlice'
import { persistStore, persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage";
const persistConfig = {
  key: "root",
  storage,
};
const persistedReducer = persistReducer(
  persistConfig,
  combineReducers({
    user: userReducer,
    ticket:ticketReducer
  })
);
const store = configureStore({
  reducer: persistedReducer,
  middleware: (m) => m({ serializableCheck: false }),
});
export let persistor = persistStore(store);
export default store;
